package com.wzzc.controller;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wzzc.bean.Msg;
import com.wzzc.service.UserService;

@Controller
public class MenuController {
	
	@Autowired
	private UserService userService;
	
	@ResponseBody
	@RequestMapping("/menuClassQuery")
	public Msg menuClassQuery() {
		List<String> classNames = userService.getAllClassName();
		StringBuffer stringBuffer=new StringBuffer();
		for (int i = 0; i < classNames.size(); i++) {
			stringBuffer.append(
					"<dl class=\"layui-nav-child\">" + 
					"	<dd data-info=\"查询班级学生信息\">" + 
					"		<a href=\"classInfoUI?className="+classNames.get(i)+"\" target=\"content\"><font style=\"margin-left: 26px;\">"+classNames.get(i)+"</font></a>" + 
					"	</dd>" + 
					"</dl>"
					);
			stringBuffer.append("\n");
		}
		return Msg.success(null).putData("html", stringBuffer.toString());
	}
	
}
